package com.micangcaihang.common.utils;

import com.micangcaihang.common.http.ApiCode;
import com.micangcaihang.common.http.exception.ApiException;

/**
 * <pre>
 *     author : Fandy
 *     e-mail : fandayongfly@gmail.com
 *     time   : 2017/08/02
 *     update : 2017/08/02
 *     desc   : 网络判断工具类
 *     version: 1.0
 * </pre>
 */

public class NetWorkCheckUtils {
    public static boolean isHttpException(ApiException e) {
        if (e.getCode() == ApiCode.Request.NETWORK_ERROR ||
                e.getCode() == ApiCode.Request.SSL_ERROR ||
                e.getCode() == ApiCode.Request.TIMEOUT_ERROR) {
            return true;
        } else {
            return false;
        }
    }
}
